package top.leyi.handle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.leyi.IService.IClassService;
import top.leyi.entity.Class;
import top.leyi.utils.Result;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController


@RequestMapping("/api/class")

public class ClassHandle {

    @Autowired
    IClassService classService;

    /**
     * 获取个人班级信息
     * @param userId
     * @return
     */
    @RequestMapping(value = "/{userId}", method = RequestMethod.GET)
    public Result getClassData(@PathVariable("userId") int userId){
        return new Result(200, classService.queryClass(userId));
    }
    /**
     * 获取所有班级信息
     *
     * @return
     */
    @RequestMapping(value = "/all", method = RequestMethod.GET)
    public Result getAllClassData(){

        return new Result(200, classService.queryAllClass());
    }



}
